<?
class adminModel extends iMVC_Model{

   public $_table='admin'; 
   public $_pk='admin_id';

   /*
    *验证账号密码
    *
    */
   public function checkPass($name,$pass){
   
        $reader=$this->db->getDbReader();
        $sql="select * from $this->_table where admin_name='$name' and admin_pass='$pass'";
        $res=$reader->readByQuery($sql);

        if($res!=null){

            $this->properties=array_merge($this->properties,$res[0]);

            return true;
        }
        else{
            return false; 
        
        }
   
   
   }
   //检查用户名是否存在,存在返回true;
   public function checkNameExist($name){
   
        $reader=$this->db->getDbReader();
        $sql="select * from $this->_table where admin_name='$name'";
        $res=$reader->readByQuery($sql);
   
        if($res!=null){

            return true;
        }
        else{
            return false; 
        
        }
   }

}



// vim600:ts=4 st=4 foldmethod=marker foldmarker=<<<,>>>
// vim600:syn=php commentstring=//%s
